import request from '@/utils/request'

export function createWorkOrderTypeMenu(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/createWorkOrderTypeMenu',
    method: 'post',
    data: params
  })
}

export function selectAll(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/selectAll?currentPage=' + params.currentPage + '&pageSize=' + params.pageSize,
    method: 'get'
  })
}

export function selectById(id) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/selectById?id=' + id,
    method: 'get'
  })
}

export function selectByName(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/selectByName',
    method: 'post',
    data: params
  })
}

export function selectOrder() {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/selectOrder',
    method: 'get'
  })
}

export function updateContent(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/updateContent',
    method: 'post',
    data: params
  })
}

export function updateMenuUseStatus(params) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/workOrderTypeMenu/updateMenuUseStatus?id=' + params.id + '&userId=' + params.userId + '&status=' + params.status,
    method: 'get'
  })
}

export function userSelectOrder(type) {
  return request({
    url: window.CONFIG.workOrderRestIp + '/role/selectAll?type=' + type,
    method: 'get'
  })
}

export function selectAllMenuVisibleType() {
  return request({
    url: window.CONFIG.workOrderRestIp + '/role/selectAllMenuVisibleType',
    method: 'get'
  })
}
